#ifndef SERVERFUNCTION_H_INCLUDED
#define SERVERFUNCTION_H_INCLUDED

#include <stdio.h>
#include <stdlib.h>
#include "loomserver.h"


void after_write(uv_write_t* req, int status);
void after_read(uv_stream_t*, ssize_t nread, uv_buf_t buf);
void on_close(uv_handle_t *peer);
void on_server_close(uv_handle_t *handle);
void on_connection(uv_stream_t*, int status);

//static void on_send(uv_udp_send_t* req, int status);
//static void on_recv(uv_udp_t* handle, ssize_t nread, uv_buf_t buf, struct sockaddr* addr, unsigned flags);

int tcp4_server_main(int port, uv_loop_t *rloop, uv_tcp_t* rserver);
int tcp4_server_status(int port, uv_loop_t *rloop, uv_tcp_t* rserver);


#endif // SERVERFUNCTION_H_INCLUDED
